package model

import "nt-order/conf"

type OrderProduct struct {
	Store_item_id       string `json:"store_item_id"`
	Store_item_number   string `json:"store_item_number"`
	Product_id          string `json:"product_id"`
	Product_name        string `json:"product_name"`
	Product_quantity    int    `json:"product_quantity"`
	Cn_title            string `json:"cn_title"`
	Store_order_item_id string `json:"store_order_item_id"`
}

func (m *OrderProduct) GetListByCodes(orderCodes []string) []OrderProduct {
	db := conf.GetDb()
	list := make([]OrderProduct, 0)
	err := db.In("order_code", orderCodes).Find(&list)
	if err != nil {
		panic(err)
	}
	return list
}
